package vip.xiaonuo.facedoor.modular.workflow.vo;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import vip.xiaonuo.core.pojo.base.anno.WorkFlow;

import java.io.Serializable;

@Data
@NoArgsConstructor
public class WorkFlowBeanInfo implements Serializable {

    // 类名
    private String clazzName;

    // 描述
    private String description;

    // 表名
    private String tableName;

    public WorkFlowBeanInfo(Class<?> clazz){
        this.clazzName = clazz.getName();

        WorkFlow workFlowAnno = clazz.getAnnotation(WorkFlow.class);
        this.description = workFlowAnno!= null ? workFlowAnno.bizName() : "未定义工作流业务名称";

        TableName tableNameAnno = clazz.getAnnotation(TableName.class);
        this.tableName = tableNameAnno!= null ? tableNameAnno.value() : "未关联数据库表";
    }

}
